UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+iWVSr02nLg9pNA9P+07mB5qGnDCRyMXE13d1EoIHiI='
WHERE
key_id = '702a75eff6dc669eccb5fe0695d33b2cbba8db60b8a350fc735a8bff8bc8ce67'
AND (
token = '+iWVSr02nLg9pNA9P+07mB5qGnDCRyMXE13d1EoIHiI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)