UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'j8yy96+DBVt4IXw82+8RFsMFgmlJb8LaoNaM/DCflJE=' 
WHERE 
  key_id = 'c9a0d3c546e732bbca12216c71a8aee0ba71d9d448b2e3f318f79d9acb0335ae' 
  AND (
    token = 'j8yy96+DBVt4IXw82+8RFsMFgmlJb8LaoNaM/DCflJE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045