UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DsZJBbY++ADuNfsnA10OHzWfoZ9uMzn90ekjNIjhb+g=' 
WHERE 
  key_id = '3d05f8906bd5f99bcad4c77555da456f854423bdc3d5a54728fdb89c3695031c' 
  AND (
    token = 'DsZJBbY++ADuNfsnA10OHzWfoZ9uMzn90ekjNIjhb+g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030