UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oqXAOwvpPEO0wJHkhzIbfXmAFKzUMQiPnj2xO6LPHWY='
WHERE
key_id = '0e39efe44e8af3e87d8282b9678624d8ece5ada66fdadb1a1f56c3bb4173a987'
AND (
token = 'oqXAOwvpPEO0wJHkhzIbfXmAFKzUMQiPnj2xO6LPHWY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)