UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dtUd81HWhLkbn7g4AgWHqlEOLisDxJPGyenXEh04C1c='
WHERE
key_id = 'd68e28854f9d7224f31ba7359e22a2e0dd316e713d9bf256cb9d08e7eba063ea'
AND (
token = 'dtUd81HWhLkbn7g4AgWHqlEOLisDxJPGyenXEh04C1c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)