UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Lbz/p/UT10Pi7K81pREHJeqdVfS7Tt8NYbbl6Dh5KjA='
WHERE
key_id = '4d8601efe6b9959c6cce894c403b4f9a04f3eb13f3371f8d90c9493a4119b094'
AND (
token = 'Lbz/p/UT10Pi7K81pREHJeqdVfS7Tt8NYbbl6Dh5KjA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)