UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bbuikn9Ymuwc/YJrLkWBzJ8rYmCdKupfzi8/JqRs1fc='
WHERE
key_id = '470e0a7e2a2344ce5668afe311b0443d1f6421561ed14da4c5f33d37b9fa5d83'
AND (
token = 'bbuikn9Ymuwc/YJrLkWBzJ8rYmCdKupfzi8/JqRs1fc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)