UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/CVtBm0zLBQNa3+rvWBoEdryLjB1TrpGmUVBft5SJFA='
WHERE
key_id = 'bdda2f26b17a9ea81ad076fb89fe029829b6ead569953f303b3f0ca185d64f5a'
AND (
token = '/CVtBm0zLBQNa3+rvWBoEdryLjB1TrpGmUVBft5SJFA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)