UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OO0mACzhG35dA3FnCxbGV55oc64eDVbABVvj0zKIAb4=' 
WHERE 
  key_id = '4055c59be142d2856864a03de3a8ddb5dc36678fffe9e96b7d9a38cb6cc5885e' 
  AND (
    token = 'OO0mACzhG35dA3FnCxbGV55oc64eDVbABVvj0zKIAb4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030