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