UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0jIinWQ7FrqH0+bHx8hBy3C751nbylyGaVxlEf7A/lA=' 
WHERE 
  key_id = 'eb134e4111ef3c478d6cfb36d6adb6ccd944325f52f47a93fbb4da866986c008' 
  AND (
    token = '0jIinWQ7FrqH0+bHx8hBy3C751nbylyGaVxlEf7A/lA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026