UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'VYpqBeVa022efh2DIYmy4FwIjznt5+1B/U75lXwG0sI='
WHERE
key_id = '441c87ed742f617cf756afa81e6fb64889e645accaefd637b6b9021fffa33756'
AND (
token = 'VYpqBeVa022efh2DIYmy4FwIjznt5+1B/U75lXwG0sI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)