UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4PJigcjSwMch4rKJocrlJa9RgX1Mhv2reH1COkAR2O0=' 
WHERE 
  key_id = 'd828686e6c46b0e9516dd063a7fa749adefca85fdef25afbe761f84d64dfa637' 
  AND (
    token = '4PJigcjSwMch4rKJocrlJa9RgX1Mhv2reH1COkAR2O0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015