UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3hDScHZxpVH3u/F4QUFSFqdvfahap8EX0mRchIytNsQ='
WHERE
key_id = '6e0ba11310012abe6a5ce0f46db91fc6e1cef0b9d33a04f0e3bf3a33777c1c74'
AND (
token = '3hDScHZxpVH3u/F4QUFSFqdvfahap8EX0mRchIytNsQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)