UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+1j2BbnxrGBdsh6JSIjRPCGEaBVF/+Po9Mm/thoauyI=' 
WHERE 
  key_id = 'd16d5d375ffb91a6c79e898fae2f30c803d81e2d46f94bc0914d458f116ee2ea' 
  AND (
    token = '+1j2BbnxrGBdsh6JSIjRPCGEaBVF/+Po9Mm/thoauyI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029