UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z41cAreK+M+m/Lld3/tlvTqR4DjPzCRZmeHGNPoysTE='
WHERE
key_id = 'fd1c578f041507a4fb114a754dd7a0211d6d1ef421e6de4b0968dc2c61c2acb1'
AND (
token = 'z41cAreK+M+m/Lld3/tlvTqR4DjPzCRZmeHGNPoysTE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)