UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cjJXbRfHmiSa9Q2b+7XC+qFTfh/WYYJai8IVahlOoYU=' 
WHERE 
  key_id = '890fda0c80f578176314049bfce377f6fcb2a7b5ee83b5fb33b8883f4980a988' 
  AND (
    token = 'cjJXbRfHmiSa9Q2b+7XC+qFTfh/WYYJai8IVahlOoYU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023