UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oWdk/4LR0olY1wmvBVfHXYzoqobrbyzC6r6Sg88AuEQ='
WHERE
key_id = '6fa3367ebd07e2ed9a97b049f9d6955bce49ac98fa65d9dc86af596822c520d2'
AND (
token = 'oWdk/4LR0olY1wmvBVfHXYzoqobrbyzC6r6Sg88AuEQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)