UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'j0nYJGqmQ6t0aCuJums4YMsz/v3o5xRXJ2A0RZ6ncLA='
WHERE
key_id = '0e79b2503a03d2e90877bcdfe44a75066cb85cccf56503f569677d6678755f03'
AND (
token = 'j0nYJGqmQ6t0aCuJums4YMsz/v3o5xRXJ2A0RZ6ncLA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)