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