UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'z4w/YdvJlujDDXGPeZX2DlIXqD+xU0GzWldm5zzxdCk='
WHERE
key_id = '7a23f50a1ea77bcc70083dd494e0e383e3a9346ec631b2bcdbf20fbb6e0fbfe3'
AND (
token = 'z4w/YdvJlujDDXGPeZX2DlIXqD+xU0GzWldm5zzxdCk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)