UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bvpPrHsdTGM+IBiz0Nj6wTadWTkCk0n58FADJR3jPuw=' 
WHERE 
  key_id = '6e0ddc9cf2df8fcb7cb54d87a7d9e6af78c4a88b550b1db25ac0ba24ff6b9c26' 
  AND (
    token = 'bvpPrHsdTGM+IBiz0Nj6wTadWTkCk0n58FADJR3jPuw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029