UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'z95qtPCIJXQHbxlFy+kp1dTX7YOyBTkO0Ha0DHUhuBs=' 
WHERE 
  key_id = 'caf2185fb38d155daa7212222df0f7a1cf3934a93fcabe69befc6203b20533bb' 
  AND (
    token = 'z95qtPCIJXQHbxlFy+kp1dTX7YOyBTkO0Ha0DHUhuBs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031