UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'K/UpMDasUjvkcRfgbVSF9cCWeEQgMkcxzkdsj1mi1/0=' 
WHERE 
  key_id = 'b6ae940b2271d7d0ce0f17f38b9c12750069cd4e8a36b7365606652ac213d9b2' 
  AND (
    token = 'K/UpMDasUjvkcRfgbVSF9cCWeEQgMkcxzkdsj1mi1/0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028