UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bbnhnLLVrjERWD3iNYuAmlFdYSAwxsvO8MJVcN1uPE0='
WHERE
key_id = '610d7088b14985c1de244115d1aa2da0a066e4b3324c6b65587a2f00ee57b05c'
AND (
token = 'bbnhnLLVrjERWD3iNYuAmlFdYSAwxsvO8MJVcN1uPE0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)