UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'f3K00PDxH9cdkltrI453jAXwBp/GK/Sv3LEjxH0aVhM='
WHERE
key_id = '9839e20ec64b3d6344fa25a361505c2724aea0b8783eeedc9b5536f56fd6347c'
AND (
token = 'f3K00PDxH9cdkltrI453jAXwBp/GK/Sv3LEjxH0aVhM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)