UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b3cwfeIbubMJZEDWegGIWnzK29PoKX7YCfFAa2jPlPc='
WHERE
key_id = '693bf5fe3666422d55679cc196cb01761144c9fe4608c535a8d7671bf7717bd4'
AND (
token = 'b3cwfeIbubMJZEDWegGIWnzK29PoKX7YCfFAa2jPlPc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)