UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5n6J0IyJS1FF1dJf2V98LF78sjnbtXgBgw8znddOR5I='
WHERE
key_id = 'e6c3ea4593708945ec6f1803b63c8de26175d885832241906676c18db2c2cbbe'
AND (
token = '5n6J0IyJS1FF1dJf2V98LF78sjnbtXgBgw8znddOR5I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)