UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cV5OZneAc5XN4/7Pc4eE13FQGR0WWTsf3vEt8b/uvvE='
WHERE
key_id = '02a67f0543237fb0dc89a34a447d7164676e430ed2d540c4f9bb35c34877c123'
AND (
token = 'cV5OZneAc5XN4/7Pc4eE13FQGR0WWTsf3vEt8b/uvvE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)