UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bkcuMhpSg5IDiyDye30xP1kRMGIbSRjRYfikSUKar/g='
WHERE
key_id = '8e539b65bba6acff91cf0f7f557698c0db1029d9d931eaf583b916296f518e64'
AND (
token = 'bkcuMhpSg5IDiyDye30xP1kRMGIbSRjRYfikSUKar/g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)