UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '6staG1a6/t2uA+I+Qu8KeXdA9RTowbEjHra3KiEHNRA=' 
WHERE 
  key_id = '3f08b53eed295579374d3ed56fc077ca588f2781db17a9e48231c888f8d43afd' 
  AND (
    token = '6staG1a6/t2uA+I+Qu8KeXdA9RTowbEjHra3KiEHNRA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019