UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'BaLWr17qUvakHmXAqFcr8TKrHGw/1MmAw7wxTvu86zA='
WHERE
key_id = '0a62785eb08634884017052e508bc12722b64b1559342fa206b6978240c0cc6d'
AND (
token = 'BaLWr17qUvakHmXAqFcr8TKrHGw/1MmAw7wxTvu86zA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)