UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2OOlQy6P3ueVm/sRtvK1DPimfUfkuAovU3URxOR1FBg=' 
WHERE 
  key_id = '917239ecb4f6ff8e5b4db69d9cc4681be9d982e631116fb12525638c7fea3c20' 
  AND (
    token = '2OOlQy6P3ueVm/sRtvK1DPimfUfkuAovU3URxOR1FBg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028