UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QnKPnx2WcPJ9MA8i1ns5O++bSQTblueMaD2FnQUfwio=' 
WHERE 
  key_id = '26b74ba200547f8ab6ea734e72988a73ff54ca48bd413c87f8b7c2c8c926a826' 
  AND (
    token = 'QnKPnx2WcPJ9MA8i1ns5O++bSQTblueMaD2FnQUfwio=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037