UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q+yykFSGKKR9HPiqiRRKU8slfpWekPbpRvfW3A77XIY='
WHERE
key_id = '5002362b3f33cf31d1768e41ce526d496e65d61932848ce8fdcdcb78fecea2c9'
AND (
token = 'q+yykFSGKKR9HPiqiRRKU8slfpWekPbpRvfW3A77XIY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)